package com.java.generic;

/**
 * @program: study
 * @className: BasicHolder
 * @description: TODO
 * @author: kukuxiahuni
 * @create: 2019-12-09 17:20
 * @version: v1.0
 **/
class BasicHolder<T> {

    T element;

    void set(T arg) {
        this.element = arg;
    }

    T get() {
        return this.element;
    }

    void f() {
        System.out.println(element.getClass().getSimpleName());
    }
}

class SubType extends BasicHolder<SubType> {

}

public class CRGWithBasicHolder {

    public static void main(String[] args) {
        SubType st1 = new SubType(), st2 = new SubType();
        st1.set(st2);
        SubType st3 = st1.get();
        st1.f();

    }
}
